package com.smedi.ismedi.inmail.core.port.adapter.persistence.repository.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.smedi.ismedi.inmail.core.domain.aggregatemodel.geo.Location;
import com.smedi.ismedi.inmail.core.domain.aggregatemodel.weather.WeatherDaily;
import com.smedi.ismedi.inmail.core.domain.repository.LocationRepository;
import com.smedi.ismedi.inmail.core.domain.repository.WeatherDailyRepository;
import com.smedi.ismedi.inmail.core.port.adapter.persistence.model.LocationEntity;
import com.smedi.ismedi.inmail.core.port.adapter.persistence.model.WeatherDailyEntity;
import com.smedi.ismedi.inmail.core.port.adapter.persistence.mybatis.mapper.LocationMapper;
import com.smedi.ismedi.inmail.core.port.adapter.persistence.mybatis.mapper.WeatherDailyMapper;
import com.smedi.ismedi.web.starter.util.DozerUtil;
import lombok.AllArgsConstructor;
import lombok.NonNull;
import org.springframework.stereotype.Repository;

/**
 * 基础信息仓库实现类
 *
 * @author jiangqinxuan
 * @date 2021/08/03
 */
@Repository
@AllArgsConstructor
public class WeatherDailyRepositoryImpl extends ServiceImpl<WeatherDailyMapper, WeatherDailyEntity> implements WeatherDailyRepository, IService<WeatherDailyEntity> {
    private final DozerUtil dozerUtil;

    private final WeatherDailyMapper weatherDailyMapper;


    @Override
    public void insertWeatherDaily(@NonNull WeatherDaily weatherDaily) {
        WeatherDailyEntity weatherDailyEntity = dozerUtil.convertor(weatherDaily, WeatherDailyEntity.class);
        weatherDailyMapper.insert(weatherDailyEntity);
    }
}